package cn.iocoder.yudao.module.system.dal.mysql.holiday;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.holiday.HolidayDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.holiday.vo.*;

/**
 * 节假日信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface HolidayMapper extends BaseMapperX<HolidayDO> {

    default PageResult<HolidayDO> selectPage(HolidayPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HolidayDO>()
                .betweenIfPresent(HolidayDO::getDate, reqVO.getDate())
                .eqIfPresent(HolidayDO::getHoliday, reqVO.getHoliday())
                .eqIfPresent(HolidayDO::getYear, reqVO.getYear())
                .eqIfPresent(HolidayDO::getMonth, reqVO.getMonth())
                .eqIfPresent(HolidayDO::getDay, reqVO.getDay())
                .orderByDesc(HolidayDO::getId));
    }

}